#include <iostream>

#include "Exception.h"
#include "Parser.h"
#include "Interpreter.h"

using namespace std;

int main(int argc, char * argv[])
{
  cin.unsetf(ios::skipws);
  try
    {
      if(argc==1)
	throw new Exception("No arguments passed.\n");
      Parser p(argc,argv);
      while(p.peek())
	{
	  Interpreter i(p.pop());
	  i.run();
	}
    }
  catch(Exception * e)
    {
      cout << e->toString() << endl;
      delete e;
    }
  return 0;
}
